<include file="Public/header" title="{$title}" bdstyle="background:#f2f2f2;"/>
<include file="Public/header_back"/>
	<if condition="$type neq '5'">
    <include file="Ucenter/orderNav"/>
    </if>
    <if condition="$order_data">
	    <foreach name="order_data" item="val">
	    <article class="order-num">
	       <div class="order-num-head flex-justify">
	          <span>订单号：{$val.order_sn}</span>
	          <span>{:date('Y-m-d H:i:s',$val['add_time'])}</span>
	       </div> 
	       <div class="order-num-package clearfix" onclick="location.href='{:U('orderDetail',array('order_id'=>$val['order_id']))}'">
	          <span>{$val.goods_name}</span>
	          <div>{$val.contain_goods}</div>
	       </div>
	       <div class="num-total flex-justify">
	            <span>合计   <strong><i>¥</i> {$val.order_amount}</strong></span>
	            <if condition="$type eq '1'">
	            <a href="javascript:void(0)" onclick="delete_order('{$val.order_id}')">取消订单</a>
	            </if>
	       </div>
	    </article>
	    </foreach>
    <else/>
    	<div style="margin-top:20%;text-align:center;color:#666;">暂无数据！</div>
    </if>
<script type="text/javascript">
function delete_order(order_id){
	if(order_id == '')return false;
	$.post(
		"{:U('Ucenter/deleteOrder')}",
		{order_id:order_id},
		function(data){
			if(data.status == '1'){
				layer.msg(data.info);
				setTimeout("location.reload()",1000);
			}else{
				layer.msg(data.info);
			}
		}
	)
}
</script>
<include file="Public/footer"/>


